1. The Field of the Invention
The present invention generally relates to improving the quality of rendering graphical images such as text. More specifically, the present invention relates to improving image rendering through sub-pixel positioning of the image in a grid space based on pixel homogeneity scores.
2. Background and Related Art
Computing technology has transformed the way we work and play. Computing systems now take a wide variety of forms including desktop computers, laptop computers, tablet PC's, personal digital assistance (PDAs), and the like. Even household devices (such as refrigerators, ovens, sewing machines, security systems, and the like) have varying levels of processing capability and thus may be considered computing systems. As time moves forward, processing capabilities maybe incorporated into a number of devices that traditionally did not have such. Accordingly, the diversity of computing systems may likely increase.
Almost all computing systems that interface with human beings use a display to convey information. In many cases, the appeal of the display is considered an important attribute of the computing system. Display of textural information (e.g., Latin-based characters) typically includes processing glyphs that represent characters of a font. A glyph includes control points and instruction for connecting the control points such that an outline of corresponding character can be generated in an arbitrary grid space (e.g., a pixel grid). Often, a character or image will be defined for display at larger size and high resolution. The character can then be mathematically scaled down (or otherwise manipulated) when the character is rendered at smaller sizes and lower resolutions (or as bold, italic, etc.). Thus, a reduced number of descriptions, and potentially one description, for a character (per font) need be stored.
To scale down a character, the location of controlled points can be divided by a scaling factor. For example, to scale a character down by a scaling factor of 10, the coordinates of each control point defining the character (at the higher resolution) can be divided by 10. It may be that control points defining a character for display on a 100×100 grid are to be scaled down for display on a 10×10 grid. Thus, a control point at grid position (50, 30) can be scaled down to a controlled point at grid position (5, 3). Similarly, a control point at grid position (70, 70) can be scaled down to controlled point at grid position (7, 7), etc. According, a smaller outline representing the character may be calculated, and there is a reduced need for storing a number of different sizes of bit-maps for the character.
The small outline can then be analyzed to identify grid locations (e.g., pixels) that are to be turned on and that are to be turned off (a process often referred to as “scan conversion”). One scan conversion algorithm determines if the center of a grid position is in side or outside a resulting scale down outline. When the center of a grid position is inside the scaled down outline the grid position is turned on. On the other hand when the center of a grid position is outside the scaled down outline the grid position in turned off.
Unfortunately, at times, and especially at lower resolution and smaller font sizes, the results of scan conversion produce an unacceptable representation of a character. Unacceptable character representations can result from rounding errors in scaling down process or from the scan conversion process itself. In order to appropriately render smaller images (e.g., letters of small font size often used by handheld devices with limited processing power), an over sampling of the image is preformed. This over-sampling results in sub-pixel positioning of a bit-map image and can be used to greatly improve the appearance of a smaller image. For example, as shown in FIG. 1A the grid space 100 is divided up into a numerous amount of pixels 105 for displaying images such as glyph 115. Each pixel is over-sampled to produce a set of sub-pixels 110 for positioning a representation of the image 105 (in this instance the letter “F”). As shown, the over-sampling allows the lower size font glyph to be more accurately positioned within the grid space 100.
Although the use of sub-pixel positioning on pixel-oriented display devices has made it possible to more appropriately display text of smaller images, there are other problems associated with rendering such smaller objects. For example, diagonal lines, or narrow or curvy linier portions of larger images in can cause jaggies or dropout conditions to occur. As such, in order to more appropriately render smaller images hinting and anti-aliasing techniques have been adapted to improve the smooth appearance of smaller objects. Hinting typically ensures that the letter maintains certain attributes, while anti-aliasing techniques allow the pixels that surround the edges of a line (especially those that do not cover a full pixel) to be changed to varying shades of grey or color in order to blend the sharp edge into the back ground.
FIG. 1A illustrates an example of where anti-aliasing techniques can be used to improve image quality. As shown, the vertical edge 120 of glyph 115 is shown as being partially placed over the column of pixels supporting that vertical edge 120. In such instance, various sub-components of those pixels 105 can be turned on or off, as appropriate in order to more appropriately render the vertical edge 120 of glyph 115. For example, various sub-components of red, green and blue can be used at varying intensities to appropriately render glyph 115. Alternatively, the entire pixel 105 can be partially turned on when such sub-components are not available, or other techniques simply turn the pixel fully on or fully off depending on the percentage or fraction of sub-pixels that would be turned on or off.
Although such anti-aliasing techniques allow for smaller fonts or bit-map images to be more accurately rendered, these techniques typically produce fuzzy or jagged edges. As such, as in the case of FIG. 1A, if a small image or glyph 115 is positioned on the grid space such that several of its edges must rely on anti-aliasing techniques, the smaller images or glyphs 115 can become unacceptable or undeterminable. Accordingly, there exists a need to be able to more appropriately position a glyph in order to ensure a uniformity of sub-pixel state within each pixel.